<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class FangownerRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            "name" => "required",
            "sex"  => "required",
            "age"  => "required",
            "phone"=> "required",
            "card" => "required",
            "address"=>"required",
            "pic"  => "required",
            "email"=> "required|email"
        ];
    }
    public function messages()
    {
        return [
            "name.required" => "房东姓名不能为空",
            "sex.required" => "房东性别不能为空",
            "age.required" => "房东年龄不能为空",
            "phone.required" => "电话号码不能为空",
            "card.required" => "身份证号码不能为空",
            "address.required" => "家庭住址不能为空",
            "pic.required" => "身份证照片不能为空",
            "email.required" => "邮箱不能为空",
        ];
    }
}
